<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/include/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>编辑用户信息</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="${ctx }/layui/css/layui.css" media="all" />
<script>  
        var ctx = "${ctx}";  
    </script> 
<style type="text/css">
.layui-form-item .layui-inline {
	width: 33.333%;
	float: left;
	margin-right: 0;
}

@media ( max-width :1240px) {
	.layui-form-item .layui-inline {
		width: 100%;
		float: none;
	}
}
</style>
</head>
<body class="childrenBody">
	<form class="layui-form" style="width: 80%;margin-top: 20px;">
		<!-- 管理员id -->
		<input type="hidden" name="id" value="${user.id }" id="id"/>
		<div class="layui-form-item">
			<label class="layui-form-label">邮箱</label>
			<div class="layui-input-block">
				<input type="text" name="email" id="eMail" class="layui-input userName"
					lay-verify="email" placeholder="请输入邮箱" value="${user.email }">
			</div>
		</div>
			<div class="layui-form-item">
				<label class="layui-form-label">昵称</label>
				<div class="layui-input-block">
					<input type="text" id="nickname" class="layui-input userName"
						lay-verify="required" name="nickname" value="${user.nickname }">
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">密码</label>
				<div class="layui-input-block">
					<input type="password" id="password" class="layui-input userName"
						   lay-verify="pass" placeholder="请输入密码" name="password" value="${user.password }">
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">手机号</label>
				<div class="layui-input-block">
					<input type="text" name="mobile" class="layui-input userName"
						   lay-verify="phone" placeholder="请输入手机号" value="${user.mobile }">
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">用户状态</label>
				<div class="layui-input-block">
					<c:if test="${user.status=='0' }">
						<input type="radio" name="status" value="未激活" title="未激活" checked>
						<input type="radio" name="status" value="正常" title="正常" >
						<input type="radio" name="status" value="禁用" title="禁用">
					</c:if>
					<c:if test="${user.status=='未激活' }">
						<input type="radio" name="status" value="未激活" title="未激活" checked>
						<input type="radio" name="status" value="正常" title="正常" >
						<input type="radio" name="status" value="禁用" title="禁用">
					</c:if>
				<c:if test="${user.status=='正常' }">
					<input type="radio" name="status" value="未激活" title="未激活" >
					<input type="radio" name="status" value="正常" title="正常" checked>
					<input type="radio" name="status" value="禁用" title="禁用">
				</c:if>
				<c:if test="${user.status=='禁用' }">
					<input type="radio" name="status" value="未激活" title="未激活">
					<input type="radio" name="status" value="正常" title="正常" >
					<input type="radio" name="status" value="禁用" title="禁用" checked>
				</c:if>
				</div>
			</div>


			<div class="layui-form-item">
				<label class="layui-form-label">用户等级</label>
				<div class="layui-input-block">
					<select name="member" class="" id="member">
						<c:if test="${user.member=='0' }">
							<option value="0" selected="selected">非会员</option>
							<option value="1">一级会员</option>
							<option value="2">二级会员</option>
							<option value="3">三级会员</option>
						</c:if>
						<c:if test="${user.member=='1' }">
							<option value="0" >非会员</option>
							<option value="1" selected="selected">一级会员</option>
							<option value="2">二级会员</option>
							<option value="3">三级会员</option>
						</c:if>
						<c:if test="${user.member=='2' }">
							<option value="0" >非会员</option>
							<option value="1">一级会员</option>
							<option value="2" selected="selected">二级会员</option>
							<option value="3">三级会员</option>
						</c:if>
						<c:if test="${user.member=='3' }">
							<option value="0" >非会员</option>
							<option value="1">一级会员</option>
							<option value="2">二级会员</option>
							<option value="3" selected="selected">三级会员</option>
						</c:if>
					</select>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">上级ID</label>
				<div class="layui-input-block">
					<select name="parentId" class="" id="parentId">
						<c:if test="${user.parentId==0}">
							<option value="0" selected>请选择</option>
						</c:if>
						<c:forEach items="${userlist}" var="r">
							<c:choose>
								<c:when test="${r.id ==user.parentId}">    <!--如果 -->
									<option value="${r.id }" selected>昵称：${r.nickname }&nbsp;&nbsp;&nbsp;&nbsp;手机：${r.mobile }&nbsp;&nbsp;${r.id }&nbsp;&nbsp;${user.parentId}</option>
								</c:when>
								<c:otherwise>  <!--否则 -->
									<option value="${r.id }">昵称：${r.nickname }&nbsp;&nbsp;&nbsp;&nbsp;手机：${r.mobile }</option>
								</c:otherwise>

							</c:choose>

						</c:forEach>


					</select>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<button class="layui-btn" lay-submit="" lay-filter="editUser">立即保存</button>
				</div>
			</div>

	</form>

	<script type="text/javascript" src="${ctx }/layui/layui.js"></script>
	<script type="text/javascript" src="${ctx }/page/member/editUser.js"></script>
</body>
</html>